<?php
/**
 * Created by PhpStorm.
 * User: 1289
 * Date: 2017/4/24
 * Time: 9:43
 */
namespace core\session;

abstract class SessionInterface implements \SessionHandlerInterface {

    /**
     * 打开session
     * @param string $savePath
     * @param string $sessionName
     * @return mixed
     */
    abstract public function open($savePath, $sessionName);

    public function close()
    {
        return true;
    }

    /**
     * 读取session
     * @param $id
     * @return string
     */
    abstract public function read($id);

    /**
     * 写入session
     * @param $id
     * @param $data
     * @return bool
     */
    abstract public function write($id, $data);

    /**
     * 清除session
     * @param $id
     * @return bool
     */
    abstract public function destroy($id);

    /**
     * 工厂回收
     * @param $maxLifeTime
     * @return bool
     */
    abstract public function gc($maxLifeTime);

}